<?php
class Payments extends CI_Model {

	var $nm_status = '';
	var $cd_project = '';
	var $ds_details = '';
	var $txn_id = '';
	
	function __construct()
	{
		parent::__construct();
	}
	
	function save($entry)
	{
		//$this->nm_status = $entry['status'];
		$this->cd_project = $entry['cd_project'];
		//$this->ds_details = $entry['details'];
		//$this->txn_id = $entry['txn_id'];
		$this->db->insert('payments', $this);
		$this->db->insert_id();
	}
	
	function update($entry)
	{
		//$this->nm_status = $entry['nm_status'];
		//$this->ds_details = $entry['ds_details'];
		//$this->txn_id = $entry['txn_id'];
		$this->db->where('cd_project', $entry['cd_project']);
		$this->db->update('payments', $entry);
		
	}
	//
	function get_all()
	{
		
		$query = $this->db->get('jobs');
		return $query->result();
	}

}
/*
residence_country: US;
invoice: abc1234;
address_city: San Jose;
first_name: John;
payer_id: TESTBUYERID01;
mc_fee: 0.44;
txn_id: 533797066;
receiver_email: seller@paypalsandbox.com;
custom: xyz123;
payment_date: 20:59:17 20 Nov 2013 PST;
address_country_code: US;
address_zip: 95131;
item_name1: something;
mc_handling: 2.06;
mc_handling1: 1.67;
tax: 2.02;
address_name: John Smith;
last_name: Smith;
receiver_id: seller@paypalsandbox.com;
verify_sign: AiPC9BjkCyDFQXbSkoZcgqH3hpacAqTMPft7aU4pGwinl5p03L9o3Trs;
address_country: United States;
payment_status: Completed;
address_status: confirmed;
business: seller@paypalsandbox.com;
payer_email: buyer@paypalsandbox.com;
notify_version: 2.4;
txn_type: cart;
test_ipn: 1;
payer_status: unverified;
mc_currency: USD;
mc_gross: 12.34;
mc_shipping: 3.02;
mc_shipping1: 1.02;
item_number1: AK-1234;
address_state: CA;
mc_gross1: 9.34;
payment_type: instant;
address_street: 123, any street;
*/